{% extends 'base/base.html' %}
{% load static %}
<!doctype html>
<html lang="zh-CN">
<head>
    {% block top %}
        <meta charset="utf-8">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
    {% endblock %}

    {% block jc %}
        <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'css/style2.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'css/font-awesome.min.css' %}">
        <link rel="apple-touch-icon-precomposed" href="{% static 'images/icon/icon.png' %}">
        <link rel="shortcut icon" href="{% static 'images/icon/favicon.ico' %}">
        <script src="{% static 'js/jquery-1.11.3/jquery.min.js' %}"></script>

        <script src="/static/tiny_mce/tiny_mce.js"></script>
        <script>
            tinyMCE.init({
                'mode': 'textareas',
                'width': 700,
                'height': 600,
            })
        </script>

    {% endblock %}

</head>

{% block header %}
    <header>
  <nav class="topnav" id="topnav"><a href="{% url 'App:index' %}"><span>首页</span><span class="en">Protal</span></a><a href="{% url 'App:aboutme' %}"><span>关于我</span><span class="en">About</span></a>
      <a href="{% url 'App:register' %}"><span>注册</span><span class="en">Learn</span></a>
{#      在这里判断是否带session#}
      {% if usession %}
          <a href="{% url 'App:login' %}"><span>欢迎:{{usession}}</span><span class="en">Learn</span></a>
          <a href="{% url 'App:logingout' %}"><span>退出</span><span class="en">Learn</span></a>
          {% else %}
            <a href="{% url 'App:login' %}"><span>登录</span><span class="en">Learn</span></a></nav>
      {% endif %}

</header>



{% endblock %}

{% block body %}
    <body class="user-select" bgcolor="#EEE">
{% endblock %}


{% block content %}
    <section class="container-fluid">
        <section class="row">
            <aside class="col-sm-3 col-md-2 col-lg-2 sidebar">
                <ul class="nav nav-sidebar">
                    <li class="active"><a href="/">报告</a></li>
                </ul>
                <ul class="nav nav-sidebar">
                    <li><a href="article.html">文章</a></li>
                    <li><a href="notice.html">草稿箱</a></li>
                    <li><a href="/">评论</a></li>
                </ul>
            </aside>

            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
                <div class="row">
                    <form action="{% url 'App:update' pid %}" method="post" class="add-article-form"
                          enctype="multipart/form-data" name="f1">
                        {% csrf_token %}
                        <div class="col-md-9">
                            <h1 class="page-header">文章修改</h1>
                            <div class="form-group">
                                <h2 class="add-article-box-title"><span>标题</span></h2>
                                <input type="text" id="article-title" name="title" class="form-control"
                                       placeholder="" required autofocus autocomplete="off">
                            </div>
                            <div class="add-article-box">
                                <h2 class="add-article-box-title"><span>内容</span></h2>
                                <div class="add-article-box-content">
                                    <textarea class="form-control" id='articledata' name="content"
                                              autocomplete="off">{{ post.content }}</textarea>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <h1 class`="page-header">操作</h1>
                            <div class="add-article-box">
                                <h2 class="add-article-box-title"><span>分类</span></h2>
                                <div class="add-article-box-content">
                                    <ul class="category-list">
                                        {% for f in tagslist %}
                                            {% if f in p_tags %}
                                                <li>
                                                    <label>
                                                        <input name="category" type="checkbox" value="{{ f }}" checked>{{ f }}
                                                        <em class="hidden-md">( 栏目ID:{{ forloop.counter }})</em></label>
                                                </li>
                                            {% else %}
                                                <li>
                                                    <label>
                                                        <input name="category" type="checkbox" value="{{ f }}">{{ f }}
                                                        <em class="hidden-md">( 栏目ID:{{ forloop.counter }})</em></label>
                                                </li>
                                            {% endif %}

                                        {% endfor %}
                                    </ul>
                                </div>
                            </div>

                            <div class="add-article-box">
                                <h2 class="add-article-box-title"><span>发布</span></h2>
                                <div class="add-article-box-footer">
                                    <button class="btn btn-primary" type="submit" name="submit">提交修改</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </section>
    </section>
    <!--个人信息模态框-->
    <div class="modal fade" id="seeUserInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form action="" method="post">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">个人信息</h4>
                    </div>
                    <div class="modal-body">
                        <table class="table" style="margin-bottom:0px;">
                            <thead>
                            <tr></tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td wdith="20%">姓名:</td>
                                <td width="80%"><input type="text" value="王雨" class="form-control" name="truename"
                                                       maxlength="10" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">用户名:</td>
                                <td width="80%"><input type="text" value="admin" class="form-control" name="username"
                                                       maxlength="10" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">电话:</td>
                                <td width="80%"><input type="text" value="18538078281" class="form-control"
                                                       name="usertel" maxlength="13" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">旧密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="old_password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">新密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">确认密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="new_password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            </tbody>
                            <tfoot>
                            <tr></tr>
                            </tfoot>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--个人登录记录模态框-->
    <div class="modal fade" id="seeUserLoginlog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">登录记录</h4>
                </div>
                <div class="modal-body">
                    <table class="table" style="margin-bottom:0px;">
                        <thead>
                        <tr>
                            <th>登录IP</th>
                            <th>登录时间</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>::1:55570</td>
                            <td>2016-01-08 15:50:28</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:64377</td>
                            <td>2016-01-08 10:27:44</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:64027</td>
                            <td>2016-01-08 10:19:25</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:57081</td>
                            <td>2016-01-06 10:35:12</td>
                            <td>成功</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">朕已阅</button>
                </div>
            </div>
        </div>
    </div>
    <!--微信二维码模态框-->
    <div class="modal fade user-select" id="WeChat" tabindex="-1" role="dialog" aria-labelledby="WeChatModalLabel">
        <div class="modal-dialog" role="document" style="margin-top:120px;max-width:280px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="WeChatModalLabel" style="cursor:default;">微信扫一扫</h4>
                </div>
                <div class="modal-body" style="text-align:center"><img src="images/weixin.jpg" alt=""
                                                                       style="cursor:pointer"/></div>
            </div>
        </div>
    </div>
    <!--提示模态框-->
    <div class="modal fade user-select" id="areDeveloping" tabindex="-1" role="dialog"
         aria-labelledby="areDevelopingModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="areDevelopingModalLabel" style="cursor:default;">该功能正在日以继夜的开发中…</h4>
                </div>
                <div class="modal-body"><img src="images/baoman/baoman_01.gif" alt="深思熟虑"/>
                    <p style="padding:15px 15px 15px 100px; position:absolute; top:15px; cursor:default;">
                        很抱歉，程序猿正在日以继夜的开发此功能，本程序将会在以后的版本中持续完善！</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal">朕已阅</button>
                </div>
            </div>
        </div>
    </div>
    <!--右键菜单列表-->
    <div id="rightClickMenu">
        <ul class="list-group rightClickMenuList">
            <li class="list-group-item disabled">欢迎访问异清轩博客</li>
            <li class="list-group-item"><span>IP：</span>172.16.10.129</li>
            <li class="list-group-item"><span>地址：</span>河南省郑州市</li>
            <li class="list-group-item"><span>系统：</span>Windows10</li>
            <li class="list-group-item"><span>浏览器：</span>Chrome47</li>
        </ul>
    </div>

    <script>

        $(function () {
            {#添加标题#}
            document.getElementById('article-title').value = '{{ post.title }}'
        })

    </script>

{% endblock %}
</body>
</html>
